package com.tongtailian.www.stir.bean;

import com.tongtailian.www.stir.utils.CharUtils;
import com.tongtailian.www.stir.utils.LogUtil;

import java.io.Serializable;

/**
 * Created by liuml on 2020/9/6 16:51
 */
public class DevicesInfoBean extends BaseDataFram implements Serializable {

    private String name;
    private String hexName;
    private boolean isSelect;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public boolean isSelect() {
        return isSelect;
    }

    public void setSelect(boolean select) {
        isSelect = select;
    }

    public DevicesInfoBean(String param, String data) {
        this.type = BaseDataFramType.version;
        this.param = param;
        this.data = data;
    }
    @Override
    public void parseFrame(String frame) {
        super.parseFrame(frame);
        int position = 0;
        //具体解析
        try {
            LogUtil.d("解析数据:" + data);
//            String substring = data.substring(data4, data.length());
//            hexName = substring.substring(data4, position);
            String temp = hexStr2Str(frame.toUpperCase());//转成大写
//            String work = str2HexStr("工作组2");
//            LogUtil.d("汉字转hex : " + work);
            name = CharUtils.getLetterAndChinese(temp);
            LogUtil.d("汉字 :" + name);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
